/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "sciftbcontrat")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Sciftbcontrat.findAll", query = "SELECT s FROM Sciftbcontrat s"),
    @NamedQuery(name = "Sciftbcontrat.findBySciftbcontratid", query = "SELECT s FROM Sciftbcontrat s WHERE s.sciftbcontratid = :sciftbcontratid"),
    @NamedQuery(name = "Sciftbcontrat.findByFecha", query = "SELECT s FROM Sciftbcontrat s WHERE s.fecha = :fecha"),
    @NamedQuery(name = "Sciftbcontrat.findByRemuneracion", query = "SELECT s FROM Sciftbcontrat s WHERE s.remuneracion = :remuneracion"),
    @NamedQuery(name = "Sciftbcontrat.findByFechainicio", query = "SELECT s FROM Sciftbcontrat s WHERE s.fechainicio = :fechainicio"),
    @NamedQuery(name = "Sciftbcontrat.findByFechafin", query = "SELECT s FROM Sciftbcontrat s WHERE s.fechafin = :fechafin"),
    @NamedQuery(name = "Sciftbcontrat.findByTipo", query = "SELECT s FROM Sciftbcontrat s WHERE s.tipo = :tipo"),
    @NamedQuery(name = "Sciftbcontrat.findByReferencias", query = "SELECT s FROM Sciftbcontrat s WHERE s.referencias = :referencias"),
    @NamedQuery(name = "Sciftbcontrat.findByHorario", query = "SELECT s FROM Sciftbcontrat s WHERE s.horario = :horario"),
    @NamedQuery(name = "Sciftbcontrat.findByNumero", query = "SELECT s FROM Sciftbcontrat s WHERE s.numero = :numero"),
    @NamedQuery(name = "Sciftbcontrat.findByFecharegistro", query = "SELECT s FROM Sciftbcontrat s WHERE s.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Sciftbcontrat.findByObservaciones", query = "SELECT s FROM Sciftbcontrat s WHERE s.observaciones = :observaciones")})
public class Sciftbcontrat implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "sciftbcontratid")
    private Integer sciftbcontratid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecha")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    @Basic(optional = false)
    @NotNull
    @Column(name = "remuneracion")
    private double remuneracion;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fechainicio")
    @Temporal(TemporalType.DATE)
    private Date fechainicio;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fechafin")
    @Temporal(TemporalType.DATE)
    private Date fechafin;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "tipo")
    private String tipo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "referencias")
    private String referencias;
    @Size(max = 100)
    @Column(name = "horario")
    private String horario;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(name = "numero")
    private String numero;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecharegistro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Size(max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "sciftbcontratid")
    private Collection<Sciftbactcont> sciftbactcontCollection;

    public Sciftbcontrat() {
    }

    public Sciftbcontrat(Integer sciftbcontratid) {
        this.sciftbcontratid = sciftbcontratid;
    }

    public Sciftbcontrat(Integer sciftbcontratid, Date fecha, double remuneracion, Date fechainicio, Date fechafin, String tipo, String referencias, String numero, Date fecharegistro) {
        this.sciftbcontratid = sciftbcontratid;
        this.fecha = fecha;
        this.remuneracion = remuneracion;
        this.fechainicio = fechainicio;
        this.fechafin = fechafin;
        this.tipo = tipo;
        this.referencias = referencias;
        this.numero = numero;
        this.fecharegistro = fecharegistro;
    }

    public Integer getSciftbcontratid() {
        return sciftbcontratid;
    }

    public void setSciftbcontratid(Integer sciftbcontratid) {
        this.sciftbcontratid = sciftbcontratid;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public double getRemuneracion() {
        return remuneracion;
    }

    public void setRemuneracion(double remuneracion) {
        this.remuneracion = remuneracion;
    }

    public Date getFechainicio() {
        return fechainicio;
    }

    public void setFechainicio(Date fechainicio) {
        this.fechainicio = fechainicio;
    }

    public Date getFechafin() {
        return fechafin;
    }

    public void setFechafin(Date fechafin) {
        this.fechafin = fechafin;
    }

    public String getTipo() {
        return tipo;
    }

    public void setTipo(String tipo) {
        this.tipo = tipo;
    }

    public String getReferencias() {
        return referencias;
    }

    public void setReferencias(String referencias) {
        this.referencias = referencias;
    }

    public String getHorario() {
        return horario;
    }

    public void setHorario(String horario) {
        this.horario = horario;
    }

    public String getNumero() {
        return numero;
    }

    public void setNumero(String numero) {
        this.numero = numero;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    @XmlTransient
    public Collection<Sciftbactcont> getSciftbactcontCollection() {
        return sciftbactcontCollection;
    }

    public void setSciftbactcontCollection(Collection<Sciftbactcont> sciftbactcontCollection) {
        this.sciftbactcontCollection = sciftbactcontCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (sciftbcontratid != null ? sciftbcontratid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sciftbcontrat)) {
            return false;
        }
        Sciftbcontrat other = (Sciftbcontrat) object;
        if ((this.sciftbcontratid == null && other.sciftbcontratid != null) || (this.sciftbcontratid != null && !this.sciftbcontratid.equals(other.sciftbcontratid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Sciftbcontrat[ sciftbcontratid=" + sciftbcontratid + " ]";
    }
    
}
